<template>
  <div id="notification">
    <el-row>
      <el-button plain @click="open" type="primary">可自动关闭</el-button>
      <el-button plain @click="open2" type="primary">不会自动关闭</el-button>
      <el-button plain @click="open13" type="primary">不会自动关闭</el-button>
    </el-row>
    <hr>
    <el-row>
      <el-button plain @click="open13" type="primary">不会自动关闭</el-button>
    </el-row>
    <hr>
    <el-row>
      <el-button type="info" plain @click="open11">偏移</el-button>
    </el-row>
  </div>
</template>

<script>
export default {
  data () {
    return {
      msg: ''
    }
  },
  methods: {
    open () {
      const h = this.$createElement
      this.$notify({
        title: '标题名称',
        message: h('i', { style: 'color:teal' }, '这是提示这是提示这是提示这是提示这是提示这是提示这是提示')
      })
    },
    open2 () {
      this.$notify({
        title: '提示',
        message: '这是一条不会自动关闭的消息',
        duration: 0
      })
    },
    open13 () {
      this.$notify.success({
        title: 'info',
        message: '这是一条没有关闭按钮的消息',
        showClose: false
      })
    },
    open11 () {
      this.$notify({
        title: '偏移',
        message: '这是一条带有偏移的提示消息',
        offset: 100
      })
    }
  }
}
</script>
